home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 4 / BBS in a Box - Macintosh - Volume IV (January 1992) (BBS in a Box).iso / Files / Prog / M / LSC213.cpt / PrintMgr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-09-26  |  4.8 KB  |  260 lines  |  [TEXT/KAHL]

  1.  
  2. /*
  3.  *  PrintMgr.h
  4.  *
  5.  *  Copyright (c) 1986, 1987 THINK Technologies, Inc.
  6.  *  These interfaces are based on information copyrighted
  7.  *  by Apple Computer, Inc., 1985, 1986, 1987.
  8.  *
  9.  */
  10.  
  11. #ifndef _PrintMgr_
  12. #define _PrintMgr_
  13.  
  14. #ifndef _DialogMgr_
  15. #include "DialogMgr.h"
  16. #endif
  17.  
  18.  
  19. /* printing methods */
  20. enum { bDraftLoop, bSpoolLoop, bUser1Loop, bUser2Loop };
  21.  
  22. /* printers */
  23. enum { bDevCItoh = 1, bDevDaisy, bDevLaser };
  24. #define iDevCItoh    0x0100
  25. #define iDevDaisy    0x0200
  26. #define iDevLaser    0x0300
  27.  
  28. /* PrCtlCall parameters */
  29. #define iPrBitsCtl                 4
  30. #define lScreenBits        0x00000000
  31. #define lPaintBits        0x00000001
  32. #define lHiScreenBits    0x00000010
  33. #define lHiPaintBits    0x00000011
  34. #define iPrIOCtl                 5
  35. #define iPrEvtCtl                 6
  36. #define lPrEvtAll        0x0002FFFD
  37. #define lPrEvtTop        0x0001FFFD
  38. #define iPrDevCtl                 7
  39. #define lPrReset        0x00010000
  40. #define lPrDocOpen        0x00010000
  41. #define lPrPageEnd        0x00020000
  42. #define lPrPageClose    0x00020000
  43. #define lPrLineFeed        0x00030000
  44. #define lPrLFStd        0x0003FFFF
  45. #define lPrLFSixth        0x0003FFFF
  46. #define lPrLFEighth        0x0003FFFE
  47. #define lPrPageOpen        0x00040000
  48. #define lPrDocClose        0x00050000
  49. #define iFMgrCtl                 8
  50. #define iMscCtl                     9
  51. #define iPvtCtl                    10
  52.  
  53. /* result codes */
  54. #define iPrSavPFil    (-1)
  55. #define iIOAbort    (-27)
  56. #define iMemFullErr    (-108)
  57. #define iPrAbort    128
  58.  
  59. /* PrGeneral constants */
  60. enum {
  61.     getRslDataOp = 4,
  62.     setRslOp,
  63.     draftBitsOp,
  64.     noDraftBitsOp,
  65.     getRotnOp
  66. };
  67. #define noSuchRsl        1
  68. #define rgType1            1
  69.  
  70. /* other constants */
  71. #define sPrDrvr        "\p.Print"
  72. #define iPrDrvrRef    (-3)
  73. #define iPrPgFract     120
  74. #define iPrPgFst       1
  75. #define iPrPgMax    9999
  76. #define iPrRelease       3
  77. #define iPfMaxPgs     128
  78.  
  79.  
  80. typedef struct TPrPort {
  81.     GrafPort    gPort;
  82.     QDProcs        gProcs;
  83.     long        lGParam1;
  84.     long        lGParam2;
  85.     long        lGParam3;
  86.     long        lGParam4;
  87.     Boolean        fOurPtr;
  88.     Boolean        fOurBits;
  89. } TPrPort, *TPPrPort;
  90.  
  91. typedef struct TPrInfo {
  92.     int            iDev;
  93.     int            iVRes;
  94.     int            iHRes;
  95.     Rect        rPage;
  96. } TPrInfo, *TPPrInfo;
  97.  
  98. typedef struct TPrJob {
  99.     int            iFstPage;
  100.     int            iLstPage;
  101.     int            iCopies;
  102.     SignedByte    bJDocLoop;
  103.     Boolean        fFromUsr;
  104.     ProcPtr        pIdleProc;
  105.     StringPtr    pFileName;
  106.     int            iFileVol;
  107.     SignedByte    bFileVers;
  108.     SignedByte    bJobX;
  109. } TPrJob, *TPPrJob;
  110.  
  111. typedef enum { feedCut, feedFanfold, feedMechCut, feedOther} TFeed;
  112.  
  113. typedef struct TPrStl {
  114.     int            wDev;
  115.     int            iPageV;
  116.     int            iPageH;
  117.     SignedByte    bPort;
  118.     TFeed        feed;
  119. } TPrStl, *TPPrStl;
  120.  
  121. typedef enum { scanTB, scanBT, scanLR, scanRL} TScan;
  122.  
  123. typedef struct  TPrXInfo {
  124.     int            iRowBytes;
  125.     int            iBandV;
  126.     int            iBandH;
  127.     int            iDevBytes;
  128.     int            iBands;
  129.     SignedByte    bPatScale;
  130.     SignedByte    bULThick;
  131.     SignedByte    bULOffset;
  132.     SignedByte    bULShadow;
  133.     TScan        scan;
  134.     SignedByte    bXInfoX;
  135. } TPrXInfo, *TPPrXInfo;
  136.  
  137. typedef Rect *TPRect;
  138.  
  139. typedef struct TPrint {
  140.     int            iPrVersion;
  141.     TPrInfo        prInfo;
  142.     Rect        rPaper;
  143.     TPrStl        prStl;
  144.     TPrInfo        prInfoPT;
  145.     TPrXInfo    prXInfo;
  146.     TPrJob        prJob;
  147.     int            printX[/*19*/];
  148.     unsigned    : 14, fLstPgFst : 1, fUserScale : 1;
  149.     int            iZoomMin;
  150.     int            iZoomMax;
  151.     StringHandle hDocName;
  152.     int            pad[14];    /*  to 120 bytes  */
  153. } TPrint, *TPPrint, **THPrint;
  154.  
  155. typedef struct TPrStatus {
  156.     int            iTotPages;
  157.     int            iCurPage;
  158.     int            iTotCopies;
  159.     int            iCurCopy;
  160.     int            iTotBands;
  161.     int            iCurBand;
  162.     Boolean        fPgDirty;
  163.     Boolean        fImaging;
  164.     THPrint        hPrint;
  165.     TPPrPort    pPrPort;
  166.     PicHandle    hPic;
  167. } TPrStatus, *TPPrStatus;
  168.  
  169. typedef struct TPfPgDir {
  170.     int            iPages;
  171.     long        lPgPos[iPfMaxPgs+1];
  172. } TPfPgDir, *TPPfPgDir, **THPfPgDir;
  173.  
  174. typedef struct TPfHeader {
  175.     TPrint        print;
  176.     TPfPgDir    pfPgDir;
  177. } TPfHeader, *TPPfHeader, **THPfHeader;
  178.  
  179. typedef struct TPrDlg {
  180.     DialogRecord dlg;
  181.     ProcPtr        pFltrProc;
  182.     ProcPtr        pItemProc;
  183.     THPrint        hPrintUsr;
  184.     Boolean        fDoIt;
  185.     Boolean        fDone;
  186.     long        lUser1;
  187.     long        lUser2;
  188.     long        lUser3;
  189.     long        lUser4;
  190.   /* plus more stuff needed by the particular printing dialog */
  191. } TPrDlg, *TPPrDlg;
  192.  
  193.  
  194. /* typedefs useful for PrGeneral */
  195.  
  196. typedef struct TGnlData {
  197.     int            iOpCode;
  198.     int            iError;
  199.     long        lReserved;
  200.     /* more fields here, depending on particular call */
  201. } TGnlData;
  202.  
  203. typedef struct TRslRg {
  204.     int            iMin;
  205.     int            iMax;
  206. } TRslRg;
  207.  
  208. typedef struct TRslRec {
  209.     int            iXRsl;
  210.     int            iYRsl;
  211. } TRslRec;
  212.  
  213. typedef struct TGetRslBlk {
  214.     int            iOpCode;
  215.     int            iError;
  216.     long        lReserved;
  217.     int            iRgType;
  218.     TRslRg        xRslRg;
  219.     TRslRg        yRslRg;
  220.     int            iRslRecCnt;
  221.     TRslRec        rgRslRec[27];
  222. } TGetRslBlk;
  223.  
  224. typedef struct TSetRslBlk {
  225.     int            iOpCode;
  226.     int            iError;
  227.     long        lReserved;
  228.     THPrint        hPrint;
  229.     int            iXRsl;
  230.     int            iYRsl;
  231. } TSetRslBlk;
  232.  
  233. typedef struct TDftBitsBlk {
  234.     int            iOpCode;
  235.     int            iError;
  236.     long        lReserved;
  237.     THPrint        hPrint;
  238. } TDftBitsBlk;
  239.  
  240. typedef struct TGetRotnBlk {
  241.     int            iOpCode;
  242.     int            iError;
  243.     long        lReserved;
  244.     THPrint        hPrint;
  245.     Boolean        fLandscape;
  246.     char        bXtra;
  247. } TGetRotnBlk;
  248.  
  249.  
  250. /*  functions returning non-integral values  */
  251. pascal TPPrPort PrOpenDoc();
  252. pascal Handle PrDrvrDCE();
  253. pascal TPPrDlg PrStlInit();
  254. pascal TPPrDlg PrJobInit();
  255.  
  256. /*  low-memory globals  */
  257. extern int PrintErr : 0x944;
  258.  
  259.  
  260. #endif _PrintMgr_